MyVDEF
Called to handle general telephony operations.
pascal short MyVDEF ( TELHandle hTEL, TELTermPtr pTELTerm, TELDNHandle hDN, TELCAHandle hCA, short msg, long p1, long p2, long p3);
hTEL
- A handle to a telephone record for the user's terminal.
pTELTerm
- A pointer to a telephone terminal record. This record is the same record that is pointed to by the
pTELTerm
field of the telephone record specified by thehTEL
parameter.hDN
- A handle to a directory number structure.
hCA
- A handle to a call appearance structure.
msg
- A constant that identifies the type of message being sent to the telephone tool. See "Main Code Resource Messages," beginning on page 6-11 for a complete description of the available messages for a main code resource.
p1
- The first parameter for the specified message.
p2
- The second parameter for the specified message.
p3
- The third parameter for the specified message.
- function result
- A result code. See the description below for specific codes you can return.
DESCRIPTION
TheMyVDEF
function is the entry point to the main code resource of a telephone tool. It should inspect the message specified by themsg
parameter and respond accordingly. The first four parameters (hTEL
,pTELTerm
,hDN
, andhCA
) specify Telephone Manager data structures that your tool can access to get information it needs to perform the operation requested by themsg
parameter. For instance, if themsg
parameter containstelAnswerCallMsg
, your tool can inspect the call appearance structure specified by thehCA
parameter to get information about the incoming call. Some of these parameters are unused for some messages.The meaning of the parameters
p1
,p2
, andp3
is dependent on the message type specified by themsg
parameter. See the descriptions of the main code resource messages beginning on page 6-11 for information about these parameters for each message.Your
MyVDEF
function should return, as its function result, a result code indicating the outcome of the request. You can return an operating-system result code (for example, a Memory Manager error, if you are unable to allocate the memory you need) or a Telephone Manager result code. If your tool does not support the specified operation or feature, it should return the codetelFeatNotSupp
. If your tool does support the specified feature but the feature is not currently subscribed, your tool should return the codetelFeatNotSub
. If your tool supports the specified feature and the feature is currently subscribed but not currently available, your tool should return the codetelFeatNotAvail
. If your tool supports the requested feature but the feature is already active, your tool should return the codetelFeatActive
.SPECIAL CONSIDERATIONS
When relaying requests from applications to your tool, the Telephone Manager checks any handles passed in the requests, making sure they are on a list (maintained internally by the Telephone Manager) of valid handles. However, the Telephone Manager can sometimes relay an invalid handle--one for a terminal, directory number, or call appearance that your tool no longer supports. If your tool receives an invalid handle, it should return one of the following three result codes:telBadTermErr
(for terminals),telBadDNErr
(for directory numbers), ortelBadCAErr
(for call appearances). In addition, your tool should set to -1 the fieldtRef
of the telephone record, thednRef
field of the directory number record, or thecaRef
field of the call appearance record, depending on the type of the invalid handle.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help